<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\server\BasicDataServer;
/* @var $this yii\web\View */
/* @var $model common\models\AdminModel */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="admin-model-form">

    <?php $form = ActiveForm::begin(); ?>


    <?= $form->field($model, 'username')->textInput( $model->isNewRecord ? [] : ['readonly' =>'readonly']) ?>

    <?= $form->field($model, 'nickname')->textInput() ?>
    <?= $form->field($model, 'password_hash')->passwordInput(['maxlength' => true]) ?>
	
	<?= $form->field($model, 'role_id')->dropDownList(BasicDataServer::instance()->getRoleToOptions()) ?>
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '添加' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
